package cn.cvs.dao;

import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserMapper {
/*    //统计用户数量
    public int count();
    //查询用户列表
    public List<SysUser> getUserList();
   // public SysUser getUserById(int id);
    //模糊查询
    public List<SysUser> getUsersByRealName(String name);
    //多条件查询
    public List<SysUser> getUserListByPojo(SysUser user);

    //根据角色Id查询信息
    public List<SysUser> getUserByRoleId(Integer roleId);
    //删除用户信息
    public int delUserByRoleId(Integer roleId);*/

    /*--*/
    //根据用户名和角色id查询信息
    public List<SysUser> getUserByNameAndRoleId(@Param("name")String name,
                                                @Param("roleId")Integer id,
                                                @Param("pageIndex")Integer pageIndex,
                                                @Param("pageSize")Integer pageSize);

    //根据用户名和角色id查询用户数量
    public int getCountByNameAndRoleId(@Param("name")String name,@Param("roleId")Integer id);

    /*用户添加*/
    public int addUser(SysUser sysUser);
    //--用户删除
    public int delUser(Integer id);
    //用户修改
    public int updUser(SysUser sysUser);
    //根据用户id查看详细信息
    public SysUser getUserById(Integer id);

    //登录验证
    public SysUser login(@Param("name")String name,@Param("pwd")String pwd);
    //修改用户密码
    public int updLoginPwd(@Param("loginPwd") String pwd,@Param("loginId") Integer id);
    //验证同名
 public List<SysUser> getUserByName(String name);
 //根据roleId查询用户
    public int getUserByRoleId(Integer roleId);





}
